package com.atguigu.gmall.feign.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.entity.OrderInfo;
import com.atguigu.gmall.order.vo.OrderConfirmVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author lfy
 * @Description
 * @create 2022-10-19 11:42
 */
@RestController("/api/inner/order")
@FeignClient("service-order")
public interface OrderFeignClient {


    /**
     * 保存秒杀单
     * @param orderInfo
     * @return
     */
    @PostMapping("/seckillorder/submit")
    Result<String> saveSeckillOrder(@RequestBody OrderInfo orderInfo);

    /**
     * 获取订单确认页数据
     * @return
     */
    @GetMapping("/confirm/data")
    Result<OrderConfirmVo> getOrderConfirmData();

    /**
     * 根据订单id查询订单数据
     * @param orderId
     * @return
     */
    @GetMapping("/info/{orderId}")
    Result<OrderInfo> getOrderInfoData(@PathVariable("orderId") Long orderId);


}
